package com.webage.ejbs;

import java.util.ArrayList;

import javax.ejb.EJB;
import javax.ejb.Stateless;

import nl.saxion.act.dao.OrderDao;
import nl.saxion.act.entity.Customer;
import nl.saxion.act.entity.Order;
import nl.saxion.act.entity.Product;

@Stateless(name = "OrderBean", mappedName = "ejb/OrderBeanJNDI")  
public class OrderBean implements IOrderBean{
	private OrderDao orderdao/* = new OrderDao()*/;
	
	@Override
	public void addProduct(ProductBean product, int amount) {
		// TODO Auto-generated method stub
	}

	@Override
	public ArrayList<Order> getOverview() {
		//return orderdao.getAllOrders();
		ArrayList<Order> orderlist = new ArrayList<Order>();
		Product prod1 = new Product(10, "Kaas", "Zuivel");
	    Product prod2 = new Product(10, "Melk", "Zuivel");
	    Product prod3 = new Product(10, "Ei", "Zuivel");
	    
	    Order ord1 = new Order();
	    ord1.setCustomer(new Customer("Fleur"));
	    ord1.addProduct( prod1 );
	    ord1.addProduct( prod2 );
	    ord1.addProduct( prod3 );
	    
		orderlist.add(ord1);
		return orderlist;
	}

	@Override
	public void setDefinite() {
		//orderdao.setIsOrdered(true);
	}
}
